<template>
  <view class="container">
    <view style="height: 700rpx; border: thin solid #000">
      <jp-signature ref="signatureRef"></jp-signature>
      <view class="f mt30r">
        <u-button @click="clear">清空</u-button>
        <u-button @click="undo">撤消</u-button>
        <u-button @click="save">保存</u-button>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // 初始化当前选中的标签
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    // this.$refs.paging.reload();
  },
  /**
   * 生命周期函数--监听页面的卸载
   */
  onUnload() {
    // 卸载全局事件订阅
    uni.$off("syncRefresh");
  },

  methods: {
    save() {
      this.$refs.signatureRef.canvasToTempFilePath({
        success: (res) => {
          // 是否为空画板 无签名  //imgType 0 客户签字
     
        },
      });
    },
    clear() {
      this.$refs.signatureRef.clear();
    },
    undo() {
      this.$refs.signatureRef.undo();
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  padding: 30rpx;
}
</style>
